package com.kaishengit.service;

import java.util.List;

import com.kaishengit.dao.EmployeeDao;
import com.kaishengit.entity.Employee;
import com.kaishengit.util.PKUtil;

public class EmployeeService {
	EmployeeDao dao = new EmployeeDao();

	public Employee findByName(String username) {
		
		return dao.findByName(username);
	}

	public List<Employee> findAll() {
		
		return dao.findAll();
	}
	
	public void save(String name, String pwd, String email) {
		Employee e = new Employee();
		e.setEmail(email);
		e.setId(PKUtil.getPK());
		e.setPassword(pwd);
		e.setPic("big.jpg");
		e.setUsername(name);
		dao.save(e);
		
	}
	
}
